Skip to content

Replace manual string truncation with apr_pstrndup to fix memory leak#613

Open
metsw24-max wants to merge 1 commit intoapache:trunkfrom
metsw24-max:apr-string-truncation-memory-safety
Open

Replace manual string truncation with apr_pstrndup to fix memory leak#613
metsw24-max wants to merge 1 commit intoapache:trunkfrom
metsw24-max:apr-string-truncation-memory-safety

Conversation

@metsw24-max
Copy link

Replaced manual malloc and memcpy with apr_pstrndup to safely trim the string.
This removes a memory leak avoids edge cases like length underflow and keeps memory handling consistent with APR pools.
No functional change just safer and cleaner code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant